---
image: /generated/articles-docs-use-current-scale.png
title: useCurrentScale()
id: use-current-scale
crumb: "API"
---

# useCurrentScale()<AvailableFrom v="4.0.125" />

With this hook, you can retrieve the scale factor of the canvas.  
Useful for if you want to [measure DOM nodes](/docs/measuring).

In the [Studio](/docs/terminology/studio), it will correspond to the zoom level - the value is `1` if the zoom is at 100%.  
In the [Player](/docs/terminology/player), it will correspond to the scale that is needed to fit the video canvas in the Player.

```tsx twoslash title="MyComp.tsx"
import { Sequence, useCurrentScale } from "remotion";

const MyVideo = () => {
  const scale = useCurrentScale();

  return <div>The current scale is {scale}</div>;
};
```

If you are outside of a Remotion context, the hook will throw an error.  
If you want to avoid this error and return a default scale, you can pass an options object with the property `dontThrowIfOutsideOfRemotion` set to `true`.  
In this case, the hook will return `1`.

```tsx twoslash title="MyComp.tsx"
import { useCurrentScale } from "remotion";

const MyRegularReactComponent = () => {
  const scale = useCurrentScale({ dontThrowIfOutsideOfRemotion: true });

  return <div>The current scale is {scale}</div>;
};
```

## See also

- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/use-current-scale.ts)
- [Measuring DOM nodes](/docs/measuring)
